﻿using System.Text.RegularExpressions;

namespace MergeInfo.NetworkData.Analysis.DianPing
{
    public class ShanghaiAnalyzer : IAreaAnalyzer
    {
        public bool IsCurrentArea(string html)
        {
            string m = @"<a id=""G_loc"" href=""/citylist""><span>(?<text>[^</span></a>]*)</span></a>";
            MatchCollection matchCollection = Regex.Matches(html, m);
            if (matchCollection.Count == 0 || matchCollection.Count > 1)
                return false;

            if (matchCollection[0].Groups["text"].Value == "上海站")
                return true;
            return false;
        }
    }
}
